<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>修改密码</title>
    <script src="../js/layui/layui.js"></script>
    <link rel="stylesheet" href="../js/layui/css/layui.css"/>
    <style>
        .editPassWoord{
            position:absolute;
            top:30%;
            left:35%;
            width:800px;
            height:400px;
            margin-top:-150px;
            margin-left:-30px;
        }
    </style>
</head>
<body>
<div class="editPassWoord">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md6">
            <div class="layui-card">
                <div class="layui-card-header" align="center"><h2>修改密码</h2></div>
                <div class="layui-card-body">
                    <form class="layui-form" id="pwdForm" method="post">
                        <div class="layui-row">
                            <div class="layui-col-xs2">旧密码</div>
                            <div class="layui-col-xs9">
                                <input type="password" name="passWord"  placeholder="输入新密码" class="layui-input">
                            </div>
                        </div><br>
                        <div class="layui-row">
                            <div class="layui-col-xs2">新密码</div>
                            <div class="layui-col-xs9">
                                <input type="password" name="pwd1"  placeholder="输入新密码" class="layui-input">
                            </div>
                        </div><br>
                        <div class="layui-row">
                            <div class="layui-col-xs2">确认密码</div>
                            <div class="layui-col-xs9">
                                <input type="password" name="pwd2"  placeholder="确认密码" class="layui-input">
                            </div>
                        </div><br>
                        <div class="layui-row" align="center">
                            <button type="button" class="layui-btn" onclick="editPassWord()">修改密码</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script>
    var $;
    layui.use(['form', 'layedit'], function(){
        $=layui.jquery;
    })

    //修改密码
    function editPassWord(){
        $.ajax({
            url:"../company/editPassWord",
            type:"post",
            data:$("#pwdForm").serialize(),
            success:function(data){
                if(data.code==0){
                    alert(data.msg);
                    parent.location="../page/toComLogin";
                }else{
                    alert(data.msg);
                }
            }
        });
    }

    //跳转注册页面
    function login(){
        location.href="../page/toLogin";
    }

</script>
</html>